#include <iostream>
#include <mutex>

class Foo {
private:
  std::mutex LockB;
  std::mutex LockC;
public:
    Foo() {
      LockB.lock();
      LockC.lock();
    }

    void first(function<void()> printFirst) {
        
        // printFirst() outputs "first". Do not change or remove this line.
        printFirst();
	LockB.unlock();
    }

    void second(function<void()> printSecond) {
        
        // printSecond() outputs "second". Do not change or remove this line.
        printSecond();
	LockC.unlock();
    }

    void third(function<void()> printThird) {
        
        // printThird() outputs "third". Do not change or remove this line.
        printThird();
    }
};

